package com.service.impl;

import java.util.List;

import com.bean.Book;
import com.bean.Page;
import com.dao.BookDao;
import com.dao.impl.BookDaoImpl;
import com.service.BookService;

public class BookServiceImpl implements BookService {

	private BookDao bookDao=new BookDaoImpl();
	@Override
	public Page<Book> getAllBook(int pageNum,int pageSize) {
		List<Book> bookList= bookDao.selectAllBook(pageNum,pageSize);
		int rows =bookDao.selectBookNums();
		Page<Book> page=new Page(bookList,pageNum,pageSize,rows);
		return page;
	}
	@Override
	public int deleteBook(int bookId) {
		return bookDao.deleteBookById(bookId);
	}

}
